import { createSlice } from "@reduxjs/toolkit";
const demo  = 1;
console.log("firstStore",demo)
const countStore = createSlice({
    // store 命名 唯一
    name: 'counter',
    // 响应式数据定义
    initialState: {
        count: 0
    },
    // 响应式数据修改方法定义
    reducers: {
        ins(state) {
            state.count++;
        },
        dec(state) {
            state.count--;
        }
    }
});
const {ins,dec,}  = countStore.actions;
const reducer = countStore.reducer;
export {ins,dec};
export default reducer;
